﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.Security.Cryptography;

namespace InForTheCloud.OAuthLite
{
    public class OAuthClient: WebClient
    {
        OAuthSecret oauthSecret;
        public OAuthClient(OAuthSecret oauthSecret) 
        {
            if (oauthSecret == null)
                throw new ArgumentNullException("oauthSecret");
            this.oauthSecret = oauthSecret;
        }

        protected override WebRequest GetWebRequest(Uri address)
        {
            var request = base.GetWebRequest(address);
            return request.OAuthRequest(oauthSecret);
        }
    }
}
